import { createRouter, createWebHistory } from 'vue-router'
import Discover from '../views/DiscoverPage.vue'
import Channel from '../views/ChannelList.vue'
import Mine from '../views/MinePage.vue'
import Profile from '../views/ProfilePage.vue'
import SearchPanel from '../views/SearchPanel.vue'

const routes = [
  {
    path: '/',
    redirect: '/discover'  // 默认跳转到发现页
  },
  {
    path: '/discover',
    component: Discover
  },
  {
    path: '/channel',
    component: Channel
  },
  {
    path: '/mine',
    component: Mine
  },
  {
    path: '/profile',
    component: Profile
  },
  {
    path: '/search-panel',
    component: SearchPanel
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router